#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class OrderItems
	 {
	     #region Member Variables

	     private Int32 _orderItemID;

	     private DateTime _addedDate;

	     private String _addedBy;

	     private Int32 _orderID;

	     private Int32 _productID;

	     private String _title;

	     private String _sKU;

	     private Decimal _unitPrice;

	     private Int32 _quantity;

	     #endregion



	     #region Public Properties

	     public Int32 OrderItemID
	     {
		     get { return _orderItemID; }
		     set { _orderItemID = value; }
	     }

	     public DateTime AddedDate
	     {
		     get { return _addedDate; }
		     set { _addedDate = value; }
	     }

	     public String AddedBy
	     {
		     get { return _addedBy; }
		     set { _addedBy = value; }
	     }

	     public Int32 OrderID
	     {
		     get { return _orderID; }
		     set { _orderID = value; }
	     }

	     public Int32 ProductID
	     {
		     get { return _productID; }
		     set { _productID = value; }
	     }

	     public String Title
	     {
		     get { return _title; }
		     set { _title = value; }
	     }

	     public String SKU
	     {
		     get { return _sKU; }
		     set { _sKU = value; }
	     }

	     public Decimal UnitPrice
	     {
		     get { return _unitPrice; }
		     set { _unitPrice = value; }
	     }

	     public Int32 Quantity
	     {
		     get { return _quantity; }
		     set { _quantity = value; }
	     }

	     #endregion

	     #region public static Methods
	     public static int Insert(OrderItems obj)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.Insert(obj);
	     }

	     public static bool Update(OrderItems obj)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.Update(obj);
	     }

	     public static bool Delete(Int32 OrderItemID)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.Delete(OrderItemID); 
	     }

	     public static OrderItems GetOrderItemsByID(Int32 OrderItemID)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.GetOrderItemsByID(OrderItemID);
	     }

	     //Get All OrderItems
	     public static List<OrderItems> GetAllOrderItems(int PageIndex, int PageSize)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.GetAllOrderItems(PageIndex, PageSize);
	     }

	     // Get Count All records of Table  OrderItems
	     public static int GetCountOrderItems()
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.GetCountOrderItems();
	     }


         // Get OrderItemsByOrderID
         public static List<OrderItems> GetOrderItemsByOrderID(Int32 OrderID)
         {
             OrderItemsDAL db = new OrderItemsDAL();
             return db.GetOrderItemsByOrderID(OrderID, 1, 100);
         }

	     // Get OrderItemsByOrderID
	     public static List<OrderItems> GetOrderItemsByOrderID(Int32 OrderID,int PageIndex, int PageSize)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.GetOrderItemsByOrderID(OrderID, PageIndex, PageSize);
	     }

	     // Get OrderItemsCountByOrderID
	     public static int GetOrderItemsCountByOrderID(Int32 OrderID)
	     {
		     OrderItemsDAL db = new OrderItemsDAL();
		     return db.GetOrderItemsCountByOrderID(OrderID);
	     }

	     #endregion
	 }
}
